package com.sysmanage.permissions.model;

import javax.persistence.*;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name = "APP_OTHER_MEMORY_TABLE_DEFINE")
public class AppOtherMemoryTableDefine implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START

	private java.lang.Integer tableId;

	private java.lang.String refDomain;

	private java.lang.String tableName;

	private java.lang.String fieldValue;

	private java.lang.String fieldName;

	private java.lang.String whereCond;

	private java.lang.Integer status;
	//columns END


	public AppOtherMemoryTableDefine(){
	}

	public AppOtherMemoryTableDefine(
		java.lang.Integer tableId
	){
		this.tableId = tableId;
	}

	

	public void setTableId(java.lang.Integer value) {
		this.tableId = value;
	}
	
	@Id 
	@GeneratedValue(strategy=GenerationType.AUTO)	
	@Column(name = "TABLE_ID", unique = true, nullable = false, length = 10)
	public java.lang.Integer getTableId() {
		return this.tableId;
	}
	
	@Column(name = "REF_DOMAIN", nullable = true, length = 20)
	public java.lang.String getRefDomain() {
		return this.refDomain;
	}
	
	public void setRefDomain(java.lang.String value) {
		this.refDomain = value;
	}
	
	@Column(name = "TABLE_NAME", nullable = true, length = 50)
	public java.lang.String getTableName() {
		return this.tableName;
	}
	
	public void setTableName(java.lang.String value) {
		this.tableName = value;
	}
	
	@Column(name = "FIELD_VALUE", nullable = true, length = 50)
	public java.lang.String getFieldValue() {
		return this.fieldValue;
	}
	
	public void setFieldValue(java.lang.String value) {
		this.fieldValue = value;
	}
	
	@Column(name = "FIELD_NAME", nullable = true, length = 50)
	public java.lang.String getFieldName() {
		return this.fieldName;
	}
	
	public void setFieldName(java.lang.String value) {
		this.fieldName = value;
	}
	
	@Column(name = "WHERE_COND", nullable = true, length = 500)
	public java.lang.String getWhereCond() {
		return this.whereCond;
	}
	
	public void setWhereCond(java.lang.String value) {
		this.whereCond = value;
	}
	
	@Column(name = "STATUS", nullable = true, length = 10)
	public java.lang.Integer getStatus() {
		return this.status;
	}
	
	public void setStatus(java.lang.Integer value) {
		this.status = value;
	}
	
	//

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("TableId",getTableId())
			.append("RefDomain",getRefDomain())
			.append("TableName",getTableName())
			.append("FieldValue",getFieldValue())
			.append("FieldName",getFieldName())
			.append("WhereCond",getWhereCond())
			.append("Status",getStatus())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getTableId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof AppOtherMemoryTableDefine == false) return false;
		if(this == obj) return true;
		AppOtherMemoryTableDefine other = (AppOtherMemoryTableDefine)obj;
		return new EqualsBuilder()
			.append(getTableId(),other.getTableId())
			.isEquals();
	}
}

